import * as React from 'react';
import {View, Text, Image} from 'react-native';
import BasePageV5 from 'react-native-cdy-baseui/components/BasePageV5';
import {responsiveNumber} from 'react-native-responsive-number/src/index';
import ImageConstants from '../resources/ImageConstants';
import StringUtil from "react-native-cdy-baseui/utils/StringUtil";

class ExamPage extends BasePageV5 {
  constructor(props) {
    super(props);
    this.state = {data: this.getParam('data')};
  }

  renderContent() {
    const data = this.state.data;
    return (
      <View style={{flex: 1, alignItems: 'center', justifyContent: 'center'}}>
        <Image
          source={ImageConstants.IMG_BCG}
          style={{
            position: 'absolute',
            top: 0,
            left: 0,
            width: '100%',
            height: '100%',
          }}
        />
        <Image
          source={ImageConstants.IMG_SHADOW}
          style={{
            position: 'absolute',
            top: 0,
            left: 0,
            width: '100%',
            height: '100%',
          }}
        />
        <View
          style={{
            width: '80%',
            height: '80%',
            padding: responsiveNumber(10),
            alignItems: 'center',
            justifyContent: 'space-around',
          }}>
          <Text style={{color: 'white', fontSize: responsiveNumber(20)}}>
            {data.examModeNum}
          </Text>
          <Text style={{color: 'white', fontSize: responsiveNumber(15)}}>
            考试科目：{data.examSubjects}
          </Text>
          <Text style={{color: 'white', fontSize: responsiveNumber(15)}}>
            考试时间：{StringUtil.formatDate(data.examModeStartTime, 'YYYY-MM-DD HH:mm:ss', 'HH:mm:ss')}-{StringUtil.formatDate(data.examModeEndTime, 'YYYY-MM-DD HH:mm:ss', 'HH:mm:ss')}
          </Text>
          <Text style={{color: 'white', fontSize: responsiveNumber(15)}}>
            监控老师：{data.invigilator}
          </Text>
          <Text style={{color: 'white', fontSize: responsiveNumber(15)}}>
            准考证号：{data.admissionNumber}
          </Text>
        </View>
      </View>
    );
  }
}

export default ExamPage;
